'use strict';

// Declare app level module which depends on views, and components
angular.module('myApp', ['http']).
//config(['$routeProvider', function($routeProvider) {
//  $routeProvider.otherwise({redirectTo: '/view1'});
//}]).
controller("controller", ['$scope', '$http', 'HttpService',function ($scope, $http,HttpService) {

	//$http({
	//	url:'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero',
	//	method:'Jsonp',
	//}).success(function(data,header,config,status){
	//	console.log(data);
	//	$scope.moviesData=data;
	//	//响应成功
	//}).error(function(data,header,config,status){
	//	//处理响应失败
	//});



		$scope.loading=true;
	HttpService.jsonp('http://api.douban.com/v2/movie/in_theaters',{count:5,start:5},function(data){
			$scope.moviesData = data;
			setTimeout(function(){
				$scope.loading=false;
				$scope.$apply();
			},3000)
		})


}])
